// Author: Ivan Chau
package uk.ac.cam.kcic2.math;

import uk.ac.cam.kcic2.scene.Ray;

public abstract class Transform extends Matrix4 {

	public final static Transform IDENTITY = new Translation(0,0,0);
	
	protected Transform(double[][] values) {
		super(values);
	}	
	
	public abstract Transform inverse();
	
	public Ray mult(Ray r){
		Vector3D transOrigin = this.mult(r.origin);
		if (Rotation.class.isInstance(this)){
			return new Ray(transOrigin, this.mult(r.direction));
		}
		else{
			return new Ray(transOrigin, r.direction);
		}
	}
}
